/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.googlecode.flealancemarket.service.commands.impl;

import com.googlecode.flealancemarket.metamodel.PrivateMessage;
import com.googlecode.flealancemarket.service.commands.SendPrivateMessage;
import com.googlecode.flealancemarket.service.facades.MessagesFacade;

/**
 *
 * @author vanja
 */
public class SendPrivateMessageImpl implements SendPrivateMessage {

    private PrivateMessage privateMessage;
    private MessagesFacade facade;

    public void setMessage(PrivateMessage privateMessage) {
        this.privateMessage = privateMessage;
    }

    public PrivateMessage execute() {
        privateMessage.set_id(null);
        return facade.savePrivateMessage(privateMessage);
    }

    public MessagesFacade getFacade(){
        return facade;
    }
    public void setFacade(MessagesFacade facade){
        this.facade = facade;
    }
}
